/*
 * @Author: jack-ZM
 * @Date: 2022-08-02 16:11:12
 * @LastEditors: jack-ZM
 * @LastEditTime: 2022-08-12 10:27:46
 * @FilePath: /vue3ts-admin-template/src/utils/auth.ts
 * @Description: 设置读取删除本地localStorage缓存
 *
 * Copyright (c) 2022 by zsm smzhang@fiberhome.com, All Rights Reserved.
 */

export function setInfo(name: string, value: unknown) {
    return sessionStorage.setItem(name, JSON.stringify(value));
}
export function getInfo(name: string) {
    return JSON.parse(sessionStorage.getItem(name) as string) || null;
}
export function removeInfo(name: string) {
    return sessionStorage.removeItem(name);
}
export const isObject = (val: unknown): val is Record<any, any> =>
    val !== null && typeof val === 'object';
